package com.team.student.controller;

import com.sun.org.apache.xpath.internal.operations.Mod;
import com.team.student.entity.Grade;
import com.team.student.service.FindStuAndGrade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class GradeController {
    @Autowired
    private FindStuAndGrade findStuAndGrade;
    @RequestMapping(value = "/findAllGrade")
    public String findAllGrade(Model model){
        List<Grade> list = findStuAndGrade.FindAllGrade();
        model.addAttribute("grades",list);

        return "grade";
    }
}
